package com.hust.bridgecheck.repository;

import com.hust.bridgecheck.entity.SensorData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SensorDataRepository extends JpaRepository<SensorData,Integer> {
    //根据ParaID和时间间隔来取数据
    @Query(nativeQuery = true, value = "select * from sensor_data where paraid = ?1 and collect_time >= ?2 and collect_time < ?3")
    List<SensorData> getSensorDataByCollectTime(String paraid, String starttime, String endtime);
}
